/**
 * 
 */
package creditcard.factory;

import java.util.prefs.BackingStoreException;

import creditcard.account.BronzeCard;
import creditcard.account.GoldCard;
import creditcard.account.SilverCard;
import framework.account.IAccount;

/**
 * @author ekamoliddinov
 * 
 */
public class AccountFactory {
	public static IAccount createAccount(String type, String accountNumber) {
		if (type == "silver")
			return new SilverCard(accountNumber);
		if (type == "gold")
			return new GoldCard(accountNumber);
		if (type == "bronze")
			return new BronzeCard(accountNumber);
		throw new RuntimeException("The type is unchecked");
	}
}
